/*
 * All rights Reserved, Designed By DataDriver
 * Copyright:    DataDriver.Inc
 * Company:      Zhuo Wo Infomation Technology (ShangHai) CO.LTD
 */
package com.sun.bean;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

/**
 * Bean的初始化的几种方案
 * 1、实现InitializingBean,DisposableBean接口
 */

@Component
public class InitUser implements InitializingBean, DisposableBean {

    @Override
    public void destroy() throws Exception {
        System.out.println("InitUser:>>>>>>destroy销毁了");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("InitUser:>>>>>>Init初始化");
    }
}
